<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script type="text/javascript">

		var a = 255;

		//对于Number调用toString()时可以在方法中传递一个整数作为参数
		//此时它将会把数字转换为指定的进制,如果不指定则默认转换为10进制
		a = a.toString(2);

		console.log(a); //11111111
		console.log(typeof a); //string

	</script>
</head>

<body>

</body>

</html>